package models

import "gorm.io/gorm"

// 用户
type User struct {
	gorm.Model
	UserName string `gorm:"type:varchar(30);comment:'用户名'"`
	Password string `gorm:"type:char(32);comment:'密码'"`
}

func (u *User) TableName() string {
	return "user"
}

// 用户优惠券
type UserCoupon struct {
	UserId    int64 `gorm:"type:int(10);comment:'用户id'"`
	CouponId  int64 `gorm:"type:int(10);comment:'优惠券id'"`
	CouponNum int64 `gorm:"type:int(10);comment:'优惠券数量'"`
}

func (uc *UserCoupon) TableName() string {
	return "user_coupon"
}
